Magnetic disk protection mechanism, computer system comprising protection mechanism, protection method for magnetic disk, and program for protection method

ABSTRACT

A mechanical transport device includes a system for transport; and a hard disk drive attached to the system. The hard disk drive comprises a magnetic recording disk to record data, a head to read or write the data to or from the disk, and a drop sensor designed to sense a shock condition. The system for transport may be a vehicle such as a car. Additional systems are also presented.

RELATED APPLICATIONS

This application is a divisional of U.S. patent application Ser. No.11/361,116, filed Feb. 24, 2006, now U.S. Pat. No. 7,382,566 which is ofcontinuation of U.S. patent application Ser. No. 10/677,723, filed Oct.1, 2003, now U.S. Pat. No. 7,042,663 and also claims priority fromJapanese Patent Application No. 2002-291561, filed Oct. 3, 2002, all ofwhich are incorporated by reference.

FIELD OF THE INVENTION

The present invention relates to a magnetic disk device protectionmechanism, and in particular, to a mechanism that protects a magneticdisk from a shock effected when a magnetic disk device moves.

BACKGROUND OF THE INVENTION

For a portable information processing apparatus such as a notebook typecomputer, it is an important object to protect the informationprocessing apparatus from a shock effected if the apparatus isinadvertently dropped or jarred while being carried or operated. Inparticular, the structure of a magnetic disk device commonly used as astorage device for an information processing apparatus of this kind issusceptible to a shock or vibration. It is thus desirable to provide aneffective protection mechanism.

The magnetic disk device causes a magnetic head to seek a rotatingmagnetic disk to write or read data to or from the disk. Accordingly, ifthe magnetic head collides against the magnetic disk, the magnetic diskmay be damaged to hinder part or all of the data from being restored.Therefore, the shock resistant performance of the magnetic disk devicecan be improved by causing the magnetic head to “escape” from themagnetic disk before a shock or vibration occurs.

As a protection mechanism of this kind for the conventional magneticdisk device, the magnetic disk device comprises a sensor for detectingthat the magnetic disk device is inclined, and an escape control meansfor determining that the magnetic disk device is inclined on the basisof a detection signal from the sensor, to move the magnetic head to anescape area. In this case, the inclination of the magnetic disk deviceis detected as a sign of fall of the magnetic disk device to cause themagnetic head to escape from the magnetic disk (for example, refer toPatent Document 1, below).

Further, the magnetic disk device has hitherto been provided with aself-diagnosis function as its protection mechanism. A typicalself-diagnosis function is a S. M. A. R. T. (Self-Monitoring Analysisand Reporting Technology) which provides various information on a spinup time, write errors, a seek rate, and temperature and which canpredict the possibility of a failure (for example, refer to Non-PatentDocument 1, below).

[Patent Document 1]

Published Unexamined Japanese Patent Application No. 2629548 (p. 1 to 3,FIG. 1)

[Non-Patent Document 1]

“Information Technology—AT Attachment with Packet Interface—5(ATA/ATAPI-5)”, [online], Feb. 29, 2000, Technical Committee T13, (p. 39to 41).

According to the conventional technique described in Patent Document 1,the magnetic head escapes if an output from a pressure sensor thatdetects a change in the weight of the magnetic disk device indicatesthat a portable terminal apparatus in which the magnetic disk device ismounted is markedly inclined or that the apparatus has started to fall.However, this escape condition is abstract and is not definite.Accordingly, it is undeniable that there is a possibility of detectingthe inclination of the portable terminal apparatus which does notactually lead to a fall to unnecessarily cause the magnetic head toescape as in the case in which, for example, a notebook type computer isused on a user's lap. In this case, every time the portable terminalapparatus is inclined, the magnetic head escapes from the magnetic disk.Consequently, in a practical sense, this conventional technique hindersthe apparatus from being easily operated.

Further, Patent Document 1 does not describe any conditions forreturning the magnetic head if it has been mistakenly caused to escape.

Further, the S. M. A. R. T.-based self-diagnosis function for themagnetic disk device does not determine whether or not a particularshock has damaged the magnetic disk device but evaluates faults usingaccumulated statistical information on the whole magnetic disk device.Accordingly, the S. M. A. R. T. self-diagnosis provides only suchinformation as indicates that the incidence of an error or the like hasexceeded a threshold, indicating that a failure is likely to occur.Furthermore, even if a shock to the magnetic disk device damages part ofa magnetic recording area on the magnetic disk device, the presence ofthis damaged area cannot be noticed until the area is accessed if the S.M. A. R. T. is used in a normal manner.

It is thus an object of the present invention to provide a magnetic diskdevice protection mechanism which allows a magnetic head escapecondition to be set in detail and which is thus effective and practical.

It is another object of the present invention to provide aself-diagnosis for determining, if the magnetic disk device is shocked,whether or not the shock has damaged the magnetic disk device.

SUMMARY OF THE INVENTION

To accomplish the above objects, an aspect of the present invention isimplemented as a magnetic disk protection mechanism characterized bycomprising an information acquisition mechanism for acquiringinformation about an environmental change of a magnetic disk device; ashock prediction mechanism for analyzing the information acquired by theinformation acquisition mechanism together with a history thereof, andfor determining a status where the magnetic disk device is used, so asto perform a shock prediction; and a control mechanism for controllingoperations of the magnetic disk device including a magnetic head escapeoperation based on a prediction result by the shock predictionmechanism.

Specifically, the status of where the magnetic disk device is used isrepresented as the inclination or shaking of the housing of a magneticdisk device or an information processing apparatus to which the magneticdisk device is mounted. This status is determined from an accelerationeffected in the magnetic disk device or the like and detected by anacceleration sensor provided in the magnetic disk device or the like.This acceleration includes linear acceleration and angular acceleration.Furthermore, the linear acceleration includes static acceleration(gravity acceleration) that varies depending on the position of theacceleration sensor and dynamic acceleration generated by force otherthan the gravity acting on the magnetic disk device or the like.

More preferably, if the status where the magnetic disk device is usedvaries in a predetermined pattern, the shock prediction mechanismpredicts that a shock will be caused by the variation in status. Todetermine if a variation occurs in the shock prediction, history ofinput operation by a predetermined input device such as a keyboard ormouse may be referred to. On the other hand, if a variation in thestatus where the magnetic disk device is used falls within a specifiedrange for a specified period, the shock prediction mechanism does notpredict that a shock will be caused by the variation in status.

Further, after the magnetic head has escaped, if the shock predictionmechanism determines that the magnetic disk device is stable, that is,it determines that a stationary status or a similar status involvingposition changes within a specified range has lasted for a specifiedperiod, then the shock prediction mechanism notifies the controlmechanism that the magnetic disk device is stable. Upon receiving thisnotification, the control mechanism returns the escaping magnetic head.In this case, a reference for the determination by the shock predictionmechanism (return condition) can be suitably adjusted based oninformation on the status of the information processing apparatuspresent before a shock is predicted to occur, i.e. a history of theinformation acquired by the information acquiring mechanism.

Furthermore, after the magnetic head has escaped, the control mechanismholds a new access request to the magnetic disk device in an internalqueue instead of realizing the access request until the shock predictionmechanism determines that the magnetic disk device is stable. Thisprevents the magnetic head from returning while the magnetic disk deviceis unstable. It is further possible to prevent the toss of accessrequests made while the magnetic disk device is unstable.

Another aspect of the present invention is implemented as a magneticdisk protection mechanism comprising a status determination mechanismfor determining a status where a magnetic disk device is used, and acontrol mechanism for controlling operations of the magnetic deviceincluding a magnetic head escape operation based on a determinationresult by the status determination mechanism, wherein, when the statusdetermination mechanism finds the high probability of excessive shock tothe magnetic disk device, the control mechanism divides an accessrequest to the magnetic disk device into access requests with a smalldata size per access and transmits to the magnetic disk device.

Furthermore, according to another aspect of the present invention, whenthe status determination mechanism finds the high probability ofexcessive shock to the magnetic disk device, the control mechanism caninvalidate a write cache function comprised in the magnetic disk deviceto make an access to the magnetic disk.

Moreover, when data is written in a cache memory, the control mechanismcan write, instead of invalidating the write cache function, the writtendata on a magnetic disk so as to empty the cache memory.

The magnetic disk protection mechanism according to the presentinvention can be adapted to predict the occurrence of a shock to havethe magnetic head escape as described above. However, it can also beadapted to operate if a shock actually occurs, to check whether or notthe magnetic head escape could have been completed before the occurrenceof such a shock, to carry out diagnosis as to whether or not themagnetic head may have collided against and damaged the magnetic disk.The magnetic disk protection mechanism is characterized by comprising ashock prediction mechanism for predicting a possible shock to themagnetic disk device, based on a variation in an environment of themagnetic disk device; a control mechanism for controlling operations ofthe magnetic disk device including a magnetic head escape based on aprediction result by the shock prediction mechanism; and a diagnosismechanism for operating if a shock actually occurs after said controlmechanism has started causing the magnetic head to escape, to determinewhether or not the magnetic head escape has been completed before theoccurrence of the shock.

More specifically, the diagnosis mechanism makes the determination bycomparing a pre-shock period that is a time from a start of an escapeoperation of the magnetic head until the occurrence of a shock with analready measured and restored escape time required for the escapeoperation of the magnetic head. Further, if the magnetic head hasalready escaped before the magnetic head starts an escape operationunder the control of the control mechanism, the diagnosis mechanism doesnot compare the pre-shock period with the escape time but determinesthat the magnetic head has completely escaped before the occurrence ofthe shock. In this case, if the control mechanism issues a requestcommand requesting the magnetic head to perform an escape operationunder the control of the control mechanism and then within a specifiedtime, acquires a notification indicating that the command has beencompleted, then the diagnosis mechanism determines that the magnetichead had already escaped when it started an escape operation.

Moreover, the magnetic disk protection mechanism notifies the user of adiagnosis result obtained by the diagnosis mechanism and indicatingwhether or not the magnetic head may have collided against and damagedthe magnetic disk. The magnetic disk protection mechanism thus promptsthe user to execute a recovery process such as data backup.

Further, to accomplish the above objects, another aspect of the presentinvention is implemented as a computer system comprising the abovedescribed magnetic disk device. Further another aspect of the presentinvention is implemented as a program for controlling a computer torealize the functions of the above described magnetic disk protectionmechanism. This program can be provided by distributing a magnetic oroptical disk, a semiconductor memory, or other recording medium in whichthe program is stored or by distributing the program via a network.

Furthermore, to accomplish the above object, the present invention isimplemented as a magnetic disk protection method of protecting amagnetic disk by using a sensor to determine a status where a magneticdisk device is used and by having a magnetic head escape depending on adetermination result. This magnetic disk protection method ischaracterized by accumulating information histories acquired by thesensor, analyzing accumulated histories and the latest sensorinformation to recognize a change pattern of the magnetic disk devicestatus, and based on a content of the change pattern of the magneticdisk device status, executing the magnetic head escape when a shock tothe magnetic disk device is predicted.

Further, another magnetic disk protection method according to thepresent invention is characterized by comprising the steps of, based onan output by the sensor, determining a status where the magnetic diskdevice is used, controlling operations of division of an access requestto the magnetic disk device into access requests with a small data sizeper access and of transmission to said magnetic disk device when thehigh possibility of excessive shock to the magnetic disk device isfound, and executing a magnetic head escape when an excessive shock tothe magnetic disk device is predicted.

Furthermore, the method may comprise, instead of the step of dividingthe above described access request into smaller access requests, a stepof controlling operations so as to invalidate a write cache function inthe magnetic disk device to make an access to the magnetic disk when itis found that there is a high probability of an excessive shock to themagnetic disk device.

Moreover, instead of invalidating the write cache function, at each datawrite in a cache memory in said magnetic disk device, the data may bewritten to a magnetic disk so as to empty the cache memory.

Further, the present invention is also implemented as a magnetic diskprotection method such as the one described below. With this magneticdisk protection method, based on a variation in an environment of themagnetic disk device, a possible shock to the magnetic disk device ispredicted. Then, based on a result of the prediction, operations of themagnetic disk device including a magnetic head escape are controlled.Then, if a shock actually occurs after the magnetic head has startedescaping, it is determined whether or not the magnetic head escape hasbeen completed before the occurrence of the shock, by comparing apre-shock period that is a time from a start of an escape operation ofthe magnetic head until the occurrence of a shock with an alreadymeasured and restored escape time required for the escape operation ofthe magnetic head.

These operations enable diagnosis as to whether or not the magnetic headmay have collided against and damaged the magnetic disk.

According to the present invention thus configured, an effective andpractical magnetic disk device protection mechanism is provided whichmonitors the status of a magnetic disk device or an informationprocessing apparatus in which a magnetic disk device is mounted, tocontrol an operation of causing a magnetic head to escape on the basisof a magnetic head escape condition set in detail.

Further, according to the present invention, if the magnetic disk deviceor the like is unstable, preparations are made to enable the magnetichead escaping operation to be promptly performed.

Moreover, according to the present invention, self-diagnosis isimplemented in which if the magnetic disk device is actually shocked, itis determined whether or not the shock has damaged the magnetic diskdevice. The user is notified of a diagnosis result and thus prompted toexecute a recovery process such as data backup as required. Thus, if themagnetic disk has been actually damaged, it is possible to avoid asecondary fault in which the magnetic head collides against the magneticdisk to scrape the coated magnetic surface of the disk, and subsequentlythe resultant fine fragments of the surface further damage the surfaceof the disk while the magnetic disk is operating, resulting in loss ofmore data.

In a yet further embodiment of the present invention, a mechanicaltransport device includes a system for transport; and a hard disk driveattached to the system. The hard disk drive comprises a magneticrecording disk to record data, a head to read or write the data to orfrom the disk, and a drop sensor designed to sense a shock condition.The system for transport may be a vehicle such as a car.

BRIEF DESCRIPTION OF THE DRAWINGS

For a fuller understanding of the nature and advantages of the presentinvention, as well as the preferred mode of use, reference should bemade to the following detailed description read in conjunction with theaccompanying drawings.

FIG. 1 is a view showing a configuration of an information processingapparatus to which a magnetic disk device protection mechanism accordingto the present invention is applied;

FIG. 2 is a view showing the appearance of the information processingapparatus to which the magnetic disk device protection mechanismaccording to the present invention can be applied;

FIG. 3 is a view schematically showing a common configuration of amagnetic disk device;

FIG. 4 is a view schematically showing a variation in the status of theinformation processing apparatus starting with a stable status andending with the start of a fall;

FIG. 5 is a view illustrating a system configuration of the magneticdisk device protection mechanism according to the present invention;

FIG. 6 is a view showing a functional configuration of a shock manageraccording to the present invention;

FIG. 7 is a view illustrating the internal functions of the shockprediction section shown in FIG. 6, in further detail;

FIG. 8 is a view showing an example of an operation algorithm used bythe escape condition calculating section shown in FIG. 7;

FIG. 9 is a view showing an example of an operation algorithm used bythe return condition calculating section shown in FIG. 7;

FIG. 10 is a view illustrating the concept of division of an access unitaccording to the present invention;

FIG. 11 is a view illustrating operations performed if an HDD filterdriver according to the present invention receives an access requestwhile causing a magnetic head to escape;

FIG. 12 is a view showing a functional configuration of a shock manageraccording to another embodiment of the present invention;

FIG. 13 is a graph illustrating the relationship between a pre-shockperiod and an escape time for a magnetic head which relationship is usedby a diagnosis processing section for determinations;

FIG. 14 is a flow chart illustrating a method executed by the HDD filterdriver and a magnetic head position checking section to check theposition of the magnetic head; and

FIG. 15 is a flow chart illustrating the flow of a diagnosis processaccording to the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION

The following description is the best embodiment presently contemplatedfor carrying out the present invention. This description is made for thepurpose of illustrating the general principles of the present inventionand is not meant to limit the inventive concepts claimed herein.

The present invention will be described below in detail on the basis ofthe embodiment shown in the accompanying drawings.

First, the present invention will be described in brief. The presentinvention is intended for an information processing apparatus comprisinga magnetic disk device as a storage device, notably a portableinformation processing apparatus such as a notebook type computer or ahandheld computer. According to the present invention, if there is apossibility that the information processing apparatus will fall, this ispredicted to cause a magnetic head to escape from a magnetic disk. Thismakes the magnetic disk device more resistant to a shock occurring whenthe information processing apparatus actually falls. To accomplish this,a change in the status of the information processing apparatus such asits inclination or vibration is monitored and analyzed to detect a signof its possible fall according to the present invention. Further, if asign of a fall is detected, a preliminary process is executed during adata transfer process to promptly perform an operation of causing themagnetic head to escape.

Moreover, according to the present invention, if the informationprocessing apparatus is actually shocked, self-diagnosis is carried outon the basis of information obtained by, for example, monitoring achange in the status. The self-diagnosis checks whether or not theescape operation of the magnetic head was performed in time, in otherwords, whether or not the shock may have damaged the magnetic diskdevice.

FIG. 1 is a block diagram showing a configuration of an informationprocessing apparatus to which a magnetic disk device protectionmechanism according to the present embodiment is applied. FIG. 2 is aview showing the appearance of this information processing apparatus.

As shown in FIG. 1, an information processing apparatus 100 according tothe present embodiment comprises a magnetic disk device (HDD) 10 as astorage device, a sensor 20 for sensing the inclination or vibration ofthe information processing apparatus, and a host computer (a CPU and amemory) 30 that controls the magnetic disk device 10 and the sensor 20.In the present embodiment, as shown in FIG. 2, the informationprocessing apparatus 100 is described, by way of example, as an easilyportable notebook type computer, with the magnetic disk device 10installed in a housing of the computer. In this case, the host computer30 is implemented using a CPU and a main memory both used to processdata for the computer itself. Further, the magnetic disk device 10 maybe inclined, vibrated, or shocked together with the computer.Accordingly, the sensor 20 may be provided in the magnetic disk device10 or in the housing of the computer.

Therefore, in the description below, it is a precondition that theinformation processing apparatus 100 is inclined, vibrated, or shocked.However, it should be appreciated that the present invention isapplicable to the case in which the magnetic disk device 10 itself isinclined, vibrated, or shocked, depending on the configuration of theapparatus.

Then, detailed description will be given of a situation that requiresthe protection mechanism for the magnetic disk device 10.

FIG. 3 is a view schematically showing a general configuration of themagnetic disk device 10.

The structure of the magnetic disk device 10 is more resistant to ashock or vibration when the magnetic head 11 is at a predeterminedescape position that is separate from a magnetic disk 12 (unloading:position (b)) than when it is on the magnetic disk 12 (loading: position(a)). Accordingly, if the information processing apparatus 100 is likelyto be shocked hard, the shock resistant performance for the magneticdisk device 10 can be improved by causing the magnetic head 11 to escapefrom the magnetic disk 12 before it is actually shocked.

The information processing apparatus 100 is most frequently shocked hardwhen it falls from a place such as a desktop or a user's lap where it isused. Thus, it is contemplated that a sign of fall of the informationprocessing apparatus 100 may be detected to cause the magnetic head 11to escape from the magnetic disk 12 to protect the magnetic disk device10.

FIG. 4 is a schematic view showing a variation in the status of theinformation processing apparatus 100 starting with a stable status andending with the start of a fall.

As shown in FIG. 4, the information processing apparatus 100, which isstably placed on a desk or the like, is lifted by the user's hands andthus shaken (first stage). Then, as an initial fall operation, theinformation processing apparatus 100 is shaken harder and starts torotate (second stage). Then, the information processing apparatus 100falls freely (third stage). Finally, it collides against a floor or thelike and is thus shocked hard (fourth stage).

During this process, the information processing apparatus 100 starts tofall in the second stage. Accordingly, it is preferable to promptlydetect that the first stage has shifted to the second stage to start anoperation of causing the magnetic head 11 to escape as early aspossible. It is assumed that the information processing apparatus 100 isoperated on the user's lap. Provided that the height at which theinformation processing apparatus 100 is operated is 50 cm, the timerequired for the apparatus 100 to fall from the user's lap onto thefloor or the like is about 320 msec. If it is assumed that an initialfall operation during the second stage requires about 150 msec, the timeelapsing after the information processing apparatus 100 has started tofall from the user's lap and before it is shocked is about 470 msec.

If the magnetic disk device is a 2.5-inch HDD (Hard Disk Drive), thetime required for the magnetic head 11 to escape from the magnetic disk12 is about 300 msec. Consequently, the magnetic head II can escapesuccessfully before a shock occurs provided that the magnetic head 11performs the escape operation immediately after the start of the fall (ashift to the second stage). However, in view of actual situation ofoperation control or data transfer for the magnetic disk device 10, anoperation of causing the magnetic head 11 to escape cannot always bestarted immediately after the start of a fall is detected.

Today, the mechanical structure of the magnetic disk device 10 isstandardized to some degree. It is thus difficult to add a specialarrangement for forcing the magnetic head 11 to escape from the magneticdisk 12 when a possible fall is detected. Special design for thispurpose increases the production cost of the magnetic disk device 10.Therefore, to allow the magnetic head 11 to escape successfully,software, specifically an unload command is preferably used for controlas in the case with the control of loading and unloading of the magnetichead 11.

However, an HDC (Hard Disk Controller) of the common magnetic diskdevice 10 operates in a single task manner. Accordingly, while anoperation such as a data write is being performed, it is impossible torespond to the host computer 30. Thus, if the unload command is used tocontrol the escape of the magnetic head 11 and if data is being writtento or read from the magnetic disk device 10 when the host computer 30transmits the unload command to the HDC of the magnetic disk device 10,then the unload command cannot be executed before this process iscompleted. As a result, the magnetic head 11 cannot escape immediately.

Further, the magnetic disk device 10 commonly comprises a cache memory(a high speed cache) to temporarily retain data to be written to themagnetic disk 12 in this cache (write cache) before the data is writtento the magnetic disk 12, which operates at low speeds. This improves thespeed at which the magnetic disk device 10 can respond to the hostcomputer 30. Typically, the magnetic head 11 is unloaded after the writedata retained in the cache memory (dirty data) has been written to themagnetic disk 12 to flush (empty) the cache memory. Thus, if any dirtydata remains in the cache memory of the magnetic disk device 10 when theunload command is transmitted to the HDC of the magnetic disk device 10,the unload command cannot be executed before the cache is flushed. As aresult, the magnetic head 11 cannot escape immediately.

As described above, even if the time elapsing after the informationprocessing apparatus 100 has started to fall and before a shock occursis about 470 msec and the time required for the magnetic head 11 toescape from the magnetic disk 12 is about 300 msec, the magnetic head 11cannot always escape successfully before a shock occurs. Thus, certainimprovements are required to start an operation of causing the magnetichead 11 to escape immediately after the unload command has been issued.

Further, with the protection mechanism for the magnetic disk device 10according to the present embodiment, as a condition for starting anoperation of causing the magnetic head 11 to escape, it must beprecisely determined that the first stage has shifted to the secondstage as shown in FIG. 4.

The information processing apparatus 100 is more prone to be vibrated orinclined when operated on the user's lap or the like than when operatedon a desktop. In this case, if the condition for starting an operationof causing the magnetic head 11 to escape is set to be the markedinclination of the information processing apparatus 100 or its vibrationequal to or larger than a specified magnitude, then while theinformation processing apparatus 100 is being operated on the user'slap, the inclination or vibration of the information processingapparatus 100 occurring when the operator changes his or her own postureor the position of the apparatus 100 may be sensed to cause the magnetichead 11 to escape. Naturally, after the magnetic head 11 has escaped, nodata can be written to or read from the magnetic disk device 10. Thus,desired data processing temporarily cannot be executed. Further, if theinformation processing apparatus 100 is placed on the user's lap or thelike and is continuously inclined or vibrated, the operation of themagnetic disk device 10 cannot be recovered. Consequently, dataprocessing cannot be resumed.

Therefore, the inclination or vibration of the information processingapparatus 100 must be analyzed so that the magnetic disk head 11 can becaused to escape after the status of the information processingapparatus 100 has been reliably shifted to the second stage.

As described above, for the protection mechanism for the magnetic diskdevice 10, it is necessary to cause the magnetic head 11 to escape byprecisely determining that the status of the information processingapparatus 100 has shifted from first stage to second stage as shown inFIG. 4. It is also necessary to minimize the time elapsing after theunload command, causing the magnetic head 11 to escape, has been issuedand before an actual escape operation is started.

Description will be given of the system configuration and operation ofthe present embodiment which meets the above described requirements.

FIG. 5 is a view illustrating the system configuration of the protectionmechanism for the magnetic disk device 10 according to the presentembodiment.

Referring to FIG. 5, the present embodiment comprises a sensor 20 as aninformation acquiring mechanism for acquiring information on changes inenvironment such as inclination and vibration effected on theinformation processing apparatus 100, a sensor driver 31, a shockmanager 32 as an analysis mechanism and shock prediction mechanism foranalyzing the information acquired by the sensor 20 to determine thestatus of the magnetic disk device 10 to predict the occurrence of ashock, and an HDD filter driver 33 as a control mechanism forcontrolling operations of the magnetic disk device 10 on the basis ofresult of the determination by the shock manager 32.

The functions of the sensor driver 31, shock manager 32, and HDD filterdriver 33 are realized by a program controlled CPU in the host computer30. The program for controlling the CPU to realize these functions is beprovided by distributing a magnetic or optical disk, a semiconductormemory, or other recording medium in which this program is stored or bydistributing the program via a network. The program is then stored inthe magnetic disk device 10 and loaded into the memory of the hostcomputer 30. The program is then executed by the CPU to realize thefunctions of the components shown in FIG. 2.

Further, the host computer 30 comprises as typical functions anapplication 34 for executing various specific processes, a file system35 provided by an operating system (OS), an HDD driver 36 that actuallycontrols operations of the magnetic disk device 10, and an IDE devicedriver 37 that controls connections to the magnetic disk device 10.These typical functions of the host computer 30 are realized by theprogram controlled CPU.

Typically, if the application 34 accesses a data file in the magneticdisk device 10 (a write or a read), the file system 35, provided by theOS, is used. The file system 35 manages the manner in which a data filecomposed of a chunk of data is actually arranged and saved in themagnetic disk device 10. The file system 35 hides the data file from theapplication 34 to simplify the use of the magnetic disk device 10 by theapplication 34. The HDD driver 36 and the IDE device driver 37 actuallyaccess the magnetic disk device 10.

The HDD driver 36, which controls the operation of the magnetic diskdevice 10, connects to the magnetic disk device 10 via a drivercorresponding to an interface (IDE (Integrated Drive Electronics), SCSI(Small Computer System Interface), or the like) used to connect themagnetic disk device 10 to the host computer. In the present embodiment,it is assumed that the interface for the magnetic disk device 10 is anIDE and that the IDE device driver 37 is thus used. The HDD driver 36and the IDE device driver 37 access an I/O controller (for example, anIDE controller) to which the magnetic disk device 10 is connectedaccording to control provided by the file system 35. Then, the HDDdriver 36 and the IDE device driver 37 operate a predetermined I/O portin the I/O controller so that the magnetic disk device 10 can transferdata at a high speed according to instructions of the file system 35.

With the above configuration, the sensor driver 31 acquires informationon the status of the information processing apparatus 100 from thesensor 20. In the present embodiment, the sensor 20 is an accelerationsensor that detects a variation in acceleration effected on each of twoaxes (X/Y axes) or three axes (X/Y/Z axes) to provide analog outputs(accelerometer) (a three-axis acceleration sensor will hereinafter beused in the present embodiment). The term “acceleration sensor” as usedherein means an inertia sensor that measures linear or angularaccelerations. However, in general, the term “accelerometer” often meansa linear accelerometer. Further, angular accelerometers include agyroscope (an angular speed meter). The present invention can beimplemented using any of these sensors though their mounting methodsdiffer slightly.

The sensor driver 31 periodically (for example, every 10 msec) acquiresconstantly outputted acceleration information for each point of time.The acceleration information acquired from the sensor 20 includes astatic acceleration (weight acceleration) that varies depending on theposition of the sensor 20 (that is, the position of housing of themagnetic disk device 10 or information processing apparatus 100 to whichthe sensor 20 is fixed) and a dynamic acceleration resulting from force(such as a shock) exerted on the housing of the magnetic disk device 10or information processing apparatus 100. In general, the sensor 20outputs a synthesized value for these accelerations.

The shock manager 32 analyzes the acceleration information acquired bythe sensor driver 31 and the time when the acceleration occurred (timeinterval) to calculate the inclination, movement, rotation speed, oracceleration of the information processing apparatus 100 (or themagnetic disk device 10). These calculated values are accumulated in theshock manger 32 for a specified period as the last vibration history.

Further, the shock manager 32 constantly monitors the status(inclination, movement, rotation speed, or acceleration) where thehousing of the information processing apparatus 100 is currently used.Then, on the basis of the current status and the history, the shockmanager 32 determines whether or not an excessive shock will occur inthe near future (a shock prediction).

Now, the functions of the shock manager 32 will be described in detail.

FIG. 6 is a view showing a functional configuration of the shock manager32.

As shown in FIG. 6, the shock manager 32 is a timer driven moduleperiodically run by a system timer. It comprises a sensor monitorsection 61, an acceleration data history saving section 62, atime-driven control section 63, a keyboard and mouse event historysaving section 64, and a shock prediction section 65.

Every time the sensor monitor section 61 is periodically driven on thebasis of a system timer, it acquires an acceleration level for one orall of the three axes (X/Y/Z axes) measured by the sensor 20 at thattime. The acceleration level information acquired is used to predict ashock. However, a shock prediction may be carried out on the basis ofthe acceleration level of a synthesized vector for these axes or may becarried out on each axis and then on the basis of the acceleration levelfor one of the axes. However, in the latter case, a safe status isdetermined by a logical AND of determinations for the respective axes. Adangerous status is determined by a logical OR of determinations for therespective axes.

The acceleration data acquired by the sensor monitor section 61 istransmitted to the shock prediction section 65 and the acceleration datahistory saving section 62.

The acceleration data history saving section 62 saves a history ofacceleration sample data for a period sufficiently longer than the timerequired for a fall, the main cause of a possible shock during a normaloperation. For example, if acceleration data corresponding to a 5-secondhistory is sampled at 100 Hz, the number of samples is 500 (=100□5) oneach axis.

The time-driven control section 63 adjusts the actual driving period ofthe module periodically driven by the system timer or the like. Forexample, if the information processing apparatus 100 is unstable and islikely to be excessively shocked by its fall or the like (a high riskmode, described later), the time-driven control section 63 provides suchcontrol as drives the module at 100 Hz. On the other hand, if theinformation processing apparatus 100 is stable (a normal mode, describedlater), the time-driven control section 63 determines that the apparatusneed not be frequently monitored and provides such control as carriesout monitoring and related calculations at 25 Hz. By thus adaptivelyadjusting the actual driving period according to the status of theinformation processing apparatus 100, loads on the host computer 30 canbe reduced which are required to determine the status of the informationprocessing apparatus 100 and to detect its fall.

The keyboard and mouse event history saving section 64 records keyboardand mouse events that can be normally acquired as system events, for aspecified time (for example, for the past five seconds as in the casewith the history of acceleration data).

The status of an LCD panel, i.e. a display device of the informationprocessing apparatus 100 indicates an open or closed status of the panelif the LCD panel can be opened and closed as in the case in which theinformation processing apparatus 100 is a notebook type computer. Theshock prediction section 65 directly acquires this status in order todetermine the usage of the information processing apparatus 100 on thebasis of the status. For example, if the acceleration data acquired bythe sensor monitor section 61 detects a variation in acceleration value,it can be determined that the information processing apparatus 100 isunstably used if the LCD panel is open. On the other hand, if the LCDpanel is closed, it can be determined that the information processingapparatus 100 is being carried. In the latter case, the informationprocessing apparatus 100 is likely to be inadvertently dropped. Then,control may be provided such that a shock prediction reference(threshold Th) used by the shock prediction section 65 and describedlater is lowered to allow the magnetic head 11 to escape successfully byreacting sensitively to a variation in the status of the informationprocessing apparatus 100.

Likewise, events generated by operating the keyboard or the mouse aresaved to the keyboard and mouse event history saving section 64. Theseevents are also directly acquired by the shock prediction section 65 andused together with the history information in the keyboard and mouseevent history saving section 64 to determine the usage of theinformation processing apparatus 100. For example, if the keyboard orthe mouse is used to perform an input operation before the informationprocessing apparatus 100 falls, it can be determined that theinformation processing apparatus 100 has fallen while being used by theuser and that it has been unstably used on the user's lap or the like.On the other hand, if no input operations have been performed for acertain period before the image processing apparatus 100 falls, then itcan be determined that the information processing apparatus 100 hasfallen as a result of an operation of lifting the apparatus 100 with theuser's hands. These results of status determinations can be used as acondition for causing the magnetic head 11 to escape as required.Furthermore, after the magnetic head 11 has escaped, if an inputoperation is performed on the basis of user interactions using thekeyboard or the mouse, this can be used as a condition to return themagnetic head 11.

Further, by utilizing the presence or absence of an input operation, anoperation density (the amount of inputs per unit time), and an inputpattern for adjusting a reference (threshold Th) for a shock prediction,the escape conditions for the magnetic head 11 can be made furtherconsistent with the user's use status at that time.

Specifically, when a predetermined input operation was performed withina past specified period, it can be assumed that a variation inacceleration detected at the present time did not occur inadvertently asa result of the fall of the information processing apparatus 100 butobviously occurred during operation and that even if the variation is asign of a fall, the user can take action quickly to prevent the fall.Thus, when such an input operation is performed, it is possible toprovide such control as increases the threshold Th above its normalvalue to reduce the sensitivity for a variation in the status of theinformation processing apparatus 100 to hinder a sensitive escapeoperation of the magnetic head 11 associated with a variation inacceleration during operation. Furthermore, by additionally using theoperation density or the input pattern for adjusting the threshold Th,it is possible to inhibit the mere detection of an input operation fromcausing the threshold Th to be adjusted unless for example, a specifiedoperation density or higher has been detected within a past specifiedperiod.

Further, to determine whether or not the user is intentionally operatingthe mouse, it is possible to selectively incorporate, into theadjustment of the threshold Th, evaluation as to whether or not themouse cursor is following a monotonous straight track, the cursor ismoving at a speed higher than the normal one, or a double click has beencarried out. On instantaneously holding the information processingapparatus 100 in order to prevent its fall, the user may unintentionallytouch the mouse to carry out a mouse input. The selective use of mouseinputs is effective in preventing such unintentional inputs from beingmistaken for the user's intentional input operations performed duringnormal use. Likewise, for keyboard inputs, the presence of appropriatetyping intervals in a series of inputs or the like can be used as areference for determining whether or not an input operation has beenintended by the user.

The above described modules other than the time-driven control section63 can communicate with the shock prediction section 65. These modulesprovide determination information used to generate a request for theescape or return of the magnetic head 11 transmitted to the HDD filterdriver 33 by the shock prediction section 65 as well as a notificationindicating that the operation mode has been switched (this notificationwill be described later).

FIG. 7 is a view illustrating the internal functions of the shockprediction section 65 in further detail.

Referring to FIG. 7, the shock prediction section 65 comprises a recentvariation average calculating section 71, an angle calculating section72, an angular speed calculating section 73, a variation perioddetecting section 74, a free fall detecting section 75, a shockdetecting section 76, an escape condition calculating section 77, and areturn condition calculating section 78.

The recent variation average calculating section 71 mainly uses theinformation from the acceleration data history saving section 62 tocalculate the mean of accelerations (absolute values) acquired duringthe preceding predetermined period or the mean of integral values(speeds) of the accelerations. Alternatively, based on the mean ofaccelerations or speeds, a similar predetermined statistical amount maybe calculated. The statistical amount may be a weighted average acquiredby applying a weight to the present side of the time axis, an averageacquired by excluding periods having as data values outside apredetermined range, the standard deviation of a variation during theperiod, or the like.

On the basis of this calculated value, it is determined whether theinformation processing apparatus 100 is stably used or is unstably usedon the user's lap or while the user is up. This makes it possible toadaptively change sensitivity to a new acceleration, on which a shockprediction is based, between the stable status and the unstable status.That is, if the average of variations in acceleration or speed (that is,variations in the status of the information processing apparatus 100)falls within a specified range for a specified period, it can bedetermined that the information processing apparatus 100 is in thecondition in which it is forced to undergo a certain degree of vibrationwhen used, for example, it is on the user' lap or in a moving car. Itcan further be determined that this is not a sign of a fall. Thisenables the provision of such control as lowers the sensitivity on whicha shock prediction is based.

Furthermore, the above calculated value can be utilized to adapt areference for a condition for returning the magnetic head 11. That is,it is assumed that after a shock has been predicted to occur and thenthe magnetic head 11 has escaped, no excessive shocks are actuallydetected and it is then determined that the magnetic disk device isstable (a stationary status or a similar status involving positionchanges within a specified range has lasted for a specified period).Then, the HDD filter driver 33 is requested to return the magnetic head11 and then actually returns it. In this case, the determinationreference (return condition) is adaptively adjusted on the basis of thestatus preceding the prediction of occurrence of a shock, i.e. on thebasis of the history of variations in inclination or dynamicacceleration during a specified period which variations are acquiredfrom outputs from the sensor 20. For example, if the variation isrelatively large for the specified period before the escape of themagnetic head 11, it is expected that the information processingapparatus 100 has been used in an environment that intrinsically causessuch a variation in position (on the user's lap or the like).Accordingly, adjustment is made so that the magnetic head 11 is returnedunder a relatively loose return condition (even with a small variationin position).

The angle calculating section 72 tracks the inclinatory displacement ofthe information processing apparatus 100. Specifically, a predeterminedstatic gravity acceleration in a horizontal condition is used as areference. This reference value is compared with the current gravityacceleration to determine the current inclination. If this inclinationis a specified angle or larger, then in most cases, such an angle doesnot occur while the information processing apparatus 100 is being usedbut, for example, immediately after it has started to fall (immediatelyafter a shift to the second stage shown in FIG. 4). Thus, if such anangular displacement has occurred, then it is determined that a shockwill occur on the basis of a combination of this angular displacementwith the result of calculation by the angular speed calculating section73, described later. The acceleration value acquired by the sensor 20 isoften the synthesis of a dynamic acceleration and a static acceleration.Accordingly, it is necessary to use a low pass filter or the like toexclude variations falling outside a low frequency range on a frequencyaxis to extract a static acceleration.

The angular speed calculating section 73 is utilized to predict a shockby combining a value acquired by the angular speed calculating section73 with the angular displacement calculated by the angle calculatingsection 72 as described above. That is, a shock is predicted to occur ifthe information processing apparatus 100 is not only inclined through aspecified angle or larger but this angular displacement also occurs at apredetermined angular speed. In this regard, a shock is predicted tooccur even if the angular displacement does not occur at thepredetermined angular speed. An allowable limit on the angular speed maybe adaptively set according to this angle so that control can beprovided such that a shock is determined to occur if a relatively highangular speed is detected in spite of a small inclination (angulardisplacement).

One method of simply determining an angular speed using a linearaccelerometer sequentially calculates angular displacement values everyunit time, the angular displacement values being obtained from thelinear accelerometer, and alternatively uses the value obtained as anaverage angular speed.

The variation period detecting section 74 monitors the variation patternof a particular acceleration or a numerical value (for example, a speed)calculated on the basis of the acceleration. Consequently, even with avariation in acceleration the level of which is insufficient to predicta shock to occur, a shock can be predicted to occur if this variation inacceleration has a particular pattern. Specific examples of detectedpatterns include an acceleration variation pattern detected if the useris operating the information processing apparatus 100 while walking anda characteristic acceleration variation pattern detected if theinformation processing apparatus 100 slips down from the user's lapwithout any extreme rotational motion.

If the gravity acceleration varies rapidly and discontinuously, the freefall detecting section 75 detects this to determine that the informationprocessing apparatus 100 has started a free fall. If it is determinedthat the information processing apparatus 100 has started a free fall,then on the basis of this determination, a shock is determined to occur.

On the basis of the acceleration data, the shock detecting section 76determines that the information processing apparatus 100 has actuallyfallen and has been excessively shocked. Then, the shock detectingsection 76 provides the return condition calculating section 78 withinformation required to determine whether to make determination for thereturn condition after the actual shock or to promptly return themagnetic head 11 because the escape condition calculating section 77 hasmistakenly determined that the magnetic head 11 escape.

The escape condition calculating section 77 receives the informationcalculated by the above described modules other than the shock detectingsection 76 and makes a total determination to determine whether theinformation processing apparatus 100 is unstable (first stage in FIG. 4)or the magnetic head 11 must escape immediately after a fall has started(second stage in FIG. 4). In the latter case, the escape conditioncalculating section 77 requests the HDD filter driver 33 to cause themagnetic head 11 to escape. On the other hand, in the former case, theescape condition calculating section 77 notifies the IDE device driver37 that the operation mode should be switched to a high risk mode asdescribed later.

After the magnetic head 11 has escaped in response to the notificationfrom the escape condition calculating section 77, the return conditioncalculating section 78 receives the information calculated by the abovedescribed module including the shock detecting section 76 and make atotal determination to determine whether or not to return the magnetichead 11. To return the magnetic head 11, the HDD filter driver 33 isrequested to return the magnetic head 11. Further, on the basis of thedetermination result, the IDE device driver 37 is notified that theoperation mode should be switched to a normal mode, described later.

FIG. 8 is a view showing an example of an operation algorithm used bythe escape condition calculating section 77.

In this case, the escape condition for the magnetic head 11 is only theangular speed occurring in the information processing apparatus 100. Theangular speed detected by the sensor 20 (that is, the angular speedoccurring in the information processing apparatus 100) at apredetermined time is defined as ω. A threshold used to determinewhether or not to request that the magnetic head 11 escape is defined asTh. An integral value for accelerations accumulated during a historyaccumulation period is defined as v. A proportionality factor changedaccording to the current inclination (angular displacement) A is definedas k_(n). An allowable small variation is defined as b. Then, thethreshold Th is calculated, for example, using:Th=k _(n) ·v+b(where k_(n)=2 (|A|<π/6), k_(n)=1 (|A|>π/6)

Referring to FIG. 8, the escape condition calculating section 77predicts that a fall starts (second stage in FIG. 4) to cause a shock ifthe angular speed ω is larger than the threshold Th. The escapecondition calculating section 77 then requests the HDD filter driver 33to cause the magnetic head 11 to escape. Then, the escape conditioncalculating section 77 avoids allowing the magnetic head 11 to returnbefore a shock occurs or while a shock remains likely to occur. It thusstarts an escape timer to ensure that the magnetic head 11 remainsescaping for a specified period (this is accomplished using anappropriate arbitrary mechanism such as the counting of the systemtimer).

On the other hand, if the angular speed ω is higher than the half of thethreshold Th, the escape condition calculating section 77 determinesthat the information processing apparatus 100 is unstable (first stagein FIG. 4). The escape condition calculating section 77 notifies the IDEdevice driver 37 of a transition to the high risk mode, described later.It then starts a high risk mode timer in order to maintain ahigh-risk-mode operational status for a specified period.

FIG. 9 is a view showing an example of an operation algorithm used bythe return condition calculating section 78.

Referring to FIG. 9, if the angular speed ω is lower than the quarter ofthe threshold Th after the escape timer has timed out (a preset time haselapsed), then the return condition calculating section 78 determinesthat no shocks will occur. The return condition calculating section 78requests the HDD filter driver 33 to cause the magnetic head 11 toreturn.

On the other hand, if the angular speed ω is lower than one-eighth ofthe threshold Th after the high risk mode timer has timed out, then thereturn condition calculating section 78 determines that the informationprocessing apparatus 100 is stable. The return condition calculatingsection 78 requests the IDE device driver 37 to shift to a normal riskmode, described later.

In the above operation algorithm, the values such as the half andquarter of the threshold Th are only examples. Other appropriate valuesmay be used. Further, these values may be adaptively varied depending onthe result of a calculation executed by the recent variation averagecalculating section 71 or the variation period detecting section 74.Furthermore, of course, an actual shock prediction uses not only thethreshold Th for the angular speed ω but also a threshold for the resultof a total determination for the information calculated by the modulesstarting with the recent variation average calculating section 71 andending with the free fall detecting section 75.

Further, the above described configuration of the shock manager 32 andits operation algorithm simply illustrate preferred examples of thepresent embodiment. It is needless to say that various embodiments canbe accomplished depending on the type of the sensor 20 or the like aslong as the shock manager 32 determines the status of the informationprocessing apparatus 100 on the basis of outputs from the sensor 20,controls the escape and return of the magnetic head 11, or controls theswitching between the operation modes.

The HDD filter driver 33 is provided between the HDD driver 36 and theIDE device driver 37 to issue an unload command for the escape of themagnetic head 11 and a load command for the return of the magnetic head11 on the basis of corresponding instructions from the shock manager 32(requests for the escape and return of the magnetic head 11). Further,the HDD filter driver 33 controls the access of the HDD driver 36 andIDE device driver 37 to the magnetic disk device 10 to get ready toallow the magnetic head 11 to escape quickly when the informationprocessing apparatus 100 falls. Specifically, the HDD filter driver 33sets two methods of accesses to the magnetic disk device 10: a normalmode used if the information processing apparatus 100 is stable and ahigh risk mode used if the information processing apparatus 100 islikely to be excessively shocked owing to its fall. Then, the HDD filterdriver 33 switches the operation mode according to the determinationresult of the status of the information processing apparatus 100.

In the normal mode, the HDD filter driver 33 acts simply as theinterface between the HDD driver 36 and the IDE device driver 37 andperforms no special operations. On the other hand, in the high riskmode, the HDD filter driver 33 adds the following two operations to theaccess to the magnetic disk device 10 based on the control of the filesystem 35: (1) the division of an access unit and (2) the disabling of awrite cache function. These added operations, when the host computer 30issues an unload command, this unload command can be immediatelyexecuted to allow the magnetic head 11 of the magnetic disk device 10 toescape from the magnetic disk 12.

Description will be Given below of Operations of the HDD Filter Driver33 in the High Risk Mode.

(1) Division of the Access Unit

In the magnetic disk device 10, a single data file recorded in themagnetic disk 12 is composed of a plurality of consecutive blocks (datablocks) of a variable size equal to an integral multiple of size of asector, a recording unit of the magnetic disk 12 or an integral multipleof size of a cluster, the minimum recording unit of a file system.

As described above, the common magnetic disk device 10 cannot respond tothe host computer 30 while executing a data write or other process.Thus, even when the shock manger 32 detects the start of fall of theinformation processing apparatus 100 and the host computer 30 thentransmits an unload command to the magnetic disk device 10, it isimpossible to execute the unload command for the escape of the magnetichead 11 until the above process is completed. Consequently, if a datafile to be accessed contains a large data block (spanning a large numberof sectors or clusters), the unload command may have to wait for a longtime before being executed. Further, when the magnetic disk 12 isformatted, the control of the magnetic disk device 10 may be occupied bythis formatting operation for a long time.

To avoid such a situation, the HDD filter driver 33 performs theoperation described below. In the high risk mode, if a data block to beaccessed in response to a request issued by the file system 35 isrelatively large and it is thus expected to take a long time to accessthe data block, then the HDD filter driver 33 divides the data block(large block) into smaller blocks of a specified size or smaller. TheHDD filter driver 33 thus divides an access request for the data blockinto access requests for the individual smaller blocks before accessingthe magnetic disk device 10. By setting the size of the smaller block,for example, to correspond to the unit of the sector or cluster, it ispossible to minimize the time required to access the individual smallerblocks. The access request issued by the file system 35 contains atransfer data size, a write destination, and the like. Accordingly, onthe basis of the contents of the request, the size of the data block canbe recognized to determine whether or not the access requires a longtime. This serves to reduce the data size corresponding to a singleaccess. As a result, the control of the magnetic disk device 10 isoccupied by the access operation only for a specified time or shorter.

FIG. 10 is a view illustrating the concept of division of the accessunit.

In this case, as shown in FIG. 10, once all smaller blocks obtained bythe division have been accessed, the HDD filter driver 33 considers thatthe undivided large block has been completely accessed, and notifies thefile system 35 of this. Thus, the dividing operation is hidden from thefile system 35.

On the other hand, if an unload command is issued while the large blockis being accessed, it is executed once the smaller block being accessedat that time is completely accessed. This prevents a longer time fromelapsing after an unload command has been issued and before it isexecuted.

Further, if the magnetic head 11 is unloaded while the large block isbeing accessed, unprocessed smaller blocks are accumulated and saved inan internal queue in the HDD filter driver 33. Then, after the magnetichead 11 has been loaded, data transfer requests for the smaller blockssaved and waiting in the internal queue are ejected in a FIFO form.Thus, the suspended process is executed again.

(2) Disabling of the Write Cache Function

As described above, in order to improve the speed of responses to thehost computer 30, the magnetic disk device 10 comprises a cache memoryto perform a write cache operation in writing data. To perform anunloading operation to cause the magnetic head 11 to escape from themagnetic disk 12, the cache is flushed so that the magnetic data(nonvolatile data) on the magnetic disk 12 reflects the volatile data inthe cache memory before the unloading operation is performed. Thus, evenwhen the shock manager 32 detects the start of fall of the informationprocessing apparatus 100 and the host computer 30 then transmits anunload command to the magnetic disk device 10, a long time may elapseafter the cache has been flushed and before the unload command isexecuted.

To avoid this situation, the HDD filter driver 33 disables the writecache function of the magnetic disk device 10 in the high risk mode.Thus, when an unload command is issued, it can be immediately executedwithout flushing the cache to cause the magnetic head 11 to escape fromthe magnetic disk 12.

If the shock manager 32 determines that the information processingapparatus 100 is stable and the HDD filter driver 33 switches itsoperation to the normal mode, then the write cache function of themagnetic disk device 10 is enabled again.

As a variation of the above described disabling of the write cachefunction, a method can be employed which comprises flushing the cachewhenever dirty data is generated in the cache memory, to create the samecondition in which the write cache function is substantially enabled(the condition in which no dirty data is accumulated in the writecache).

When the write cache function is completely disabled, the magnetic head11 can be promptly unloaded. However, for a normal access process, itbecomes impossible to take advantage of an increase in the speed ofresponses to the host computer 30 based on the write cache.Consequently, the performance is slightly degraded.

Thus, with this method, the HDD filter driver 33 does not disable thewrite cache function in the high risk mode. Instead, every time data iswritten to the magnetic disk 12, a cache flush command is immediatelytransmitted to the magnetic disk device 10 to delete dirty datagenerated in the cache memory owing to this data write. Thus, the cachememory can be utilized for data write operations to improve the speed ofresponses to the host computer 30. On the other hand, no dirty data isaccumulated in the cache memory except when a data write is executed.This is substantially equal to the condition in which the write cachefunction is disabled.

This means that accesses to the magnetic disk device 10 do not alwaysrequire a continuous long time, so that by inserting a cache flushingoperation into an idle period of the magnetic disk device 10 betweenaccess operations, the cache memory is substantially prevented frombeing populated by dirty data in the cases where the magnetic head 11 isasynchronously subject to unloading. That is, this method produceseffects similar to those of substantial disabling of the write cachefunction.

As described above, if the information processing apparatus 100 isunstable and is likely to be shocked because of its fall, the HDD filterdriver 33 is switched to the high risk mode to control the IDE devicedriver 37. For accesses to the magnetic disk device 10, the HDD filterdriver 33 performs the following operations: (1) the division of theaccess unit and (2) the disabling of the write cache function (includingthe substantial disabling of the write cache function by the immediateflushing of the cache memory). Thus, immediately after the shock manager32 has predicted a shock, the magnetic disk head 11 is unloaded.Consequently, even if the apparatus falls by only a short distance (onlya short time elapses after a fall has started and before a shockoccurs), the magnetic head 11 can be caused to sufficiently escape fromthe magnetic disk 12.

These two additional operations are not dependent on each other butindependently reduce the time elapsing before the magnetic head 11 isunloaded. Accordingly, only one of them may be performed.

Once the shock manager determines that the information processingapparatus 100 is likely to be excessively shocked and the magnetic head11 is then unloaded, even if the file system 35 transmits a new requestfor an access to the magnetic disk device 10, the HDD filter driver 33only receives this access request and does not allow the access to beexecuted until such a high risk status is cleared. The high risk statusis cleared if a shock prediction is found incorrect and it is determinedthat the housing of the information processing apparatus 100 is nolonger subjected to changes, which have brought about the prediction,and is now stable or if a shock occurs as predicted and it is thendetermined that the information processing apparatus 100 has been stablefor a period sufficient to determine that the shock has disappeared (theperiod empirically considered to be sufficient), as described above inthe operations of the escape condition calculating section 77 and thereturn condition calculating section 78. The file system 35 cannot startthe succeeding process before the access request is completed. That is,before the information processing apparatus 100 satisfies the conditionfor returning the magnetic head 11, the magnetic head 11 is not loadedin spite of a new access request issued by the file system 35.

FIG. 11 is a view illustrating operations of the HDD filter driver 33 inthis case.

It is assumed that the file system 35 delivers a data transfer request(access request) to the HDD filter driver 33 before either of thefollowing conditions is met: the magnetic head 11 has already escapedand the information processing apparatus 100 has remained stationary fora specified period or a similar status involving position changes withina specified range has lasted for the specified period (that is, theinformation position has been stable), or an input based on a userinteraction has been executed using the mouse or keyboard in order toload the magnetic head 11. In this case, this data transfer request isaccumulated in an internal queue (data transfer request accumulationqueue) 331 in the HDD filter driver 33. Then, the condition forreturning the magnetic head 11 in the information processing apparatus100 is met, and the shock manager 32 transmits a request for the returnof the magnet head 11. Upon receiving this request, the HDD filterdriver 33 first ejects data transfer requests already accumulated in theinternal queue 331 in a FIFO form (a queue flash command). The HDDfilter driver 33 then processes the newly arriving data transferrequest. In this regard, data transfer requests arriving while theinternal queue 331 is being flushed are sequentially accumulated in theinternal queue 331 in spite of the flushing operation. This transitionstatus is thus dealt with. After all data transfer requests accumulatedin the internal queue 331 have been ejected, the process returns tonormal flow control for data transfer requests.

The above operations serve to avoid the following situation: while themagnetic head 11 is being unloaded, it inadvertently returns to itspreceding position. The subsequent external shock causes the magnetichead 11 and the magnetic disk 12 to collide against each other to damagethe magnetic disk 12. As a result, part or all of the data cannot berestored.

If the access unit is divided and if the magnetic head 11 is unloadedbefore all access requests obtained by the division have not beenprocessed, then the transmission of the unprocessed access requests tothe IDE device driver 37 remains suspended until the escaping magnetichead 11 returns. Consequently, also in this case, the magnetic head 11is prevented from returning to its preceding position to damage themagnetic disk 12.

Once the return condition for the magnetic head 11 is met, the HDDfilter driver 33 transmits an operation request to the IDE device driver37, the request being required to load and return the magnetic head 11to the magnetic disk 12 (a load command). However, this operationrequest is not required if the magnetic disk device 10 can automaticallyload the magnetic head 11 by transmitting a normal data processingrequest. However, if the time required to recover the magnetic head 11is to be reduced or omitted before the next access to the data in themagnetic disk device 10, a recovery operation request (load command) maybe transmitted once the recovery conditions for the magnetic head 11 aremet, regardless of the presence of a data access even if the magnetichead 11 is adapted to be automatically recovered in association withdata accesses.

In the above embodiment, the HDD driver 36, the HDD filter driver 33,and the IDE device driver 37 are separate modules. A single module canbe constructed and implemented which includes the functions of thesedrivers.

Further, in the present embodiment, the unload command is used to causethe magnetic head 11 to escape from the magnetic disk 12. However, forthe magnetic disk device 10 that does not include an exclusive commandfor unloading of the magnetic head 11, a power saving command (a standbycommand or the like) can be used which stops a spindle motor thatrotationally drives the magnetic disk 12, or the like.

Even the above present embodiment cannot perfectly prevent the magneticdisk device 10 from failing and malfunctioning if the magnetic head 11cannot escape in time when the information processing apparatus 100 isshocked. In the present embodiment, the inclination or vibration of theinformation processing apparatus 100 is analyzed to have the magnetichead 11 escape after the status of the information processing apparatus100 has shifted from a first stage to a second stage in FIG. 4. Thus, ifthe time after a shift to the second stage and before the occurrence ofa shock is extremely short, e.g. if the user attempts to lift theinformation processing apparatus 100 being used on a desk (in astationary state) and then inadvertently drops it, a shock may occurbefore an escape operation of the magnetic head 11 according to thepresent embodiment is completed. Consequently, the magnetic disk 12 maybe damaged.

If a shock to the magnetic disk device 10 results in permanentlydefective parts (flaws) in a magnetic recording area of the magneticdisk 12, then recorded data is directly lost from this area.Furthermore, if the magnetic head 11 collides against the surface of themagnetic disk 12 to scrape the coated magnetic surface of the disk 12and resultant fine fragments of the surface scatter inside the magneticdisk device 10, then a secondary fault may occur in which the fragmentsmay be placed between the magnetic head 11 and the magnetic disk 12,which are (appear to be) operating correctly, to cause larger flaws inthe magnetic disk 12.

If the user can accurately determine that such defects, i.e. defectiveparts resulting from physical flaws are occurring in the magneticrecording area of the magnetic disk 12, the user will desire to know howmuch they affect the system even if he or she must suspend the operationbeing performed at that time in order to do so. Further, to minimizepossible damage in the near future, it is preferable to performimmediately a recovery operation such as data backup.

Thus, as another embodiment of the present invention, the inventorspropose a means for examining whether or not the magnetic head 11completely escaped after the prediction of a shock to the magnetic diskdevice 10 and before the occurrence of an actual shock, to check whetheror not the shock has damaged the magnetic disk 12, and for notifying theuser of the necessity of action such as backup.

In the protection mechanism of the magnetic disk device 10 according tothe present embodiment, the shock manager 32 of the protection mechanismshown in FIG. 5 is additionally provided with a function of comparingthe time from the start until completion of an escape operation of themagnetic head 11 with the time from the start of the escape operationuntil the occurrence of a shock to determine whether or not the magnetichead 11 has escaped in time.

FIG. 12 is a view showing a functional configuration of the shockmanager 40 according to the present embodiment.

As shown in FIG. 12, the shock manager 40 comprises a sensor monitorsection 61, an acceleration data history saving section 62, atime-driven control section 63, a keyboard mouse event history savingsection 64, and a shock prediction section 65 all of which constitutethe shock manager 32, shown in FIG. 6, and a pre-shock time measurementsection 121, a magnetic head escape completion time measuring section122, a diagnosis processing section 123, and a magnetic head positionchecking section 124 as a means for carrying out diagnosis as to whetheror not the magnetic head 11 has escaped before the occurrence of ashock.

If the magnetic head 11 has performed an escape operation, the pre-shockperiod measurement section 121 measures the time (pre-shock period) fromthe start of the escape operation until the occurrence of an actualshock. As shown in FIG. 12, the pre-shock period measurement section 121receives an inputted notification of the start of an escape operation ofthe magnetic head 11 from the HDD filter driver 33 and records the timeof this input. Further, the pre-shock period measurement section 121receives acceleration data from the sensor monitor section 61 andrecords the time of the occurrence of the shock.

As shown in the figure, the pre-shock period measurement section 121comprises a high intensity shock estimation section 125 that analyzesacceleration data inputted by the sensor monitor section 61 to detectthe occurrence of a shock. Specifically, if a fall of the informationprocessing apparatus or the like causes an intense shock (high intensityshock) exceeding the measurable range of the sensor 20, the highintensity shock assumption section 125 determines a characteristic shockamplitude pattern detected by the sensor 20, to identify this highintensity shock. Then, the time at which the occurrence of the highintensity shock was detected is obtained.

The pre-shock period measurement section 121 calculates a pre-shock timeon the basis of the time at which the magnetic head 11 started an escapeoperation of the magnetic head 11 and which is determined on the basisof the notification from the HDD filter driver 33 and the time at whichthe high intensity shock estimation section 125 detected the highintensity shock. The pre-shock period measurement section 121 thentransmits the calculated pre-shock time to the diagnosis processingsection 123.

If the magnetic head 11 has performed an escape operation, the magnetichead escape completion time measurement section 122 measures the timerequired to complete this escape operation. As shown in FIG. 12, themagnetic head escape completion time measurement section 122 receivesinputted notifications of the start and completion of the escapeoperation of the magnetic head 11 from the HDD filter driver 33 tocalculate the time required for the escape operation, on the basis ofthe time of this input. In this connection, to reduce loads on the shockmanager 40 and the filter driver 33, it is possible to perform theoperation described below instead of measuring the time actuallyrequired for each escape of the magnetic head 11. An escape operation isactually performed before a boot or when the magnetic disk device 10 isdetected. Then, the time required for the operation is measured andsaved to a cache memory. Subsequently, the saved value is utilized asthe time required to complete an escape operation when a shock ispredicted. Furthermore, a characteristic value evaluated on the basis ofthe specification of the magnetic disk device 10 or the like may beretained in a memory such as ROM so as to be utilized as the timerequired to complete an escape operation when a shock is predicted.

The magnetic head escape completion time measurement section 122transmits the escape time of the magnetic head 11 for a predicted shockobtained as described above, to the diagnosis processing section 123.

On the basis of the pre-shock period received from the pre-shock periodmeasurement section 121 and the escape time of the magnetic head 11 fora predicted shock received from the magnetic head escape completion timemeasurement section 122, the diagnosis processing section 123 determineswhether or not the escape operation of the magnetic head 11 wassuccessfully performed before a shock occurred actually. If thediagnosis processing section 123 determines that the escape operationwas not in time, it notifies the user that the magnetic head 11 maycollide against and damage the magnetic disk 12, by outputting acorresponding warning message as a diagnosis result.

FIG. 13 is a graph illustrating the relationship between the pre-shockperiod and the escape time of the magnetic head 11 which relationship isused by the diagnosis processing section 123 for determinations.

In the present embodiment, as shown in FIG. 4, a process from the startof oscillation of the information processing apparatus 100 until theoccurrence of a shock due to falling is classified into four stages.Then, the magnetic head 11 is requested to escape when the shockprediction section 65 determines that the status of the informationprocessing apparatus 100 has shifted from a first stage to a secondstage. Accordingly, as shown in each graph in FIG. 13, a certain timeelapses from the time at which the magnetic head 11 is requested toescape until an actual shock (having an intensity exceeding thetolerable limit (maximum allowable shock range) of the magnetic diskdevice 10) occurs. This is the pre-shock period measured by thepre-shock period measurement section 121. The diagnosis processingsection 123 checks whether or not the magnetic head 11 has completed anescape operation during the pre-shock period.

As shown FIG. 13(A), if the escape time of the magnetic head 11 isshorter than the pre-shock period, it is determined that the magnetichead 11 has completely escaped before the occurrence of a shock. Thus,diagnosis result is obtained which indicates that there are not anydefective areas in the magnetic recording area of the magnetic disk 12.On the other hand, as shown in FIG. 13(B), if the escape time of themagnetic head 11 is longer than the pre-shock period, it is determinedthat the shock occurred before the magnetic head 11 escaped completely.Thus, diagnosis result is obtained which indicates that the magneticrecording area of the magnetic disk 12 contains defective areas.

The diagnosis result may be provided to the user only if the magnetichead 11 has failed to escape before the occurrence of a shock or theuser may also be notified that it is unlikely that there will be adefective area even if the magnetic head 11 has completely escapedbefore the occurrence of the shock. Further, a warning message outputtedas the diagnosis result may contain specific contents, i.e. may promptthe user to take action immediately by carrying out data backup or thelike.

In this embodiment, the pre-shock period measurement section 121calculates the pre-shock period on the basis of the time at which themagnetic head 11 started an escape operation and the time at which ashock occurred. Further, the magnetic head escape completion timemeasurement section 122 acquires the escape time of the magnetic head 11for a predicted shock to compare it with the pre-shock period. However,other implementations are possible. For example, the high intensityshock estimation section 125 may input the time at which a highintensity shock was detected, directly to the diagnosis processingsection 123. Further, the magnetic head escape completion timemeasurement section 122 may input, to the diagnosis processing section123, an escape completion time calculated on the basis of the time atwhich the magnetic head 11 started an escape operation and thepreviously measured escape time. Then, on the basis of the order ofthese times, it may be determined whether or not the magnetic head 11completely escaped before the occurrence of the shock.

The magnetic head position checking section 124 checks whether themagnetic head 11 is located over the magnetic disk 12 or away from theposition over the magnetic disk 12 and at an escape position when theshock prediction section 65 requests the HDD filter driver 33 to causethe magnetic head 11 to escape. That is, the magnetic head 11 may beunloaded regardless of a shock prediction owing to a power savingfunction or the like. If the magnetic head 11 has already been unloadedwhen the shock prediction section 65 transmits a request for an escapeof the magnetic head 11, then the diagnosis processing section 123 neednot subsequently carry out diagnosis. Accordingly, the position of themagnetic head 11 (loaded or unloaded) at this time is verified.

In this case, when an escape request transmitted by the shock predictionsection 65 causes the HDD filter driver 33 to issue an unload commandand the magnetic head 11 then escapes, the controller for the magneticdisk device 10 returns a notification indicating that the escape hasbeen completed. Accordingly, if the magnetic head 11 has already beenunloaded before an escape operation is started, a notification of thecompletion of this operation is returned in a time extremely shorterthan that required for a normal escape operation (about several dozen tohundred μsec (microseconds); for the normal escape operation: several100 msec). Thus, if an operation completion notification is returnedwithin a specified time (about 100 μsec) after the HDD filter driver 33has issued an unload command, then the notification is transmitted fromthe HDD filter driver 33 to the magnetic head position checking section124. Then, on the basis of this notification, the magnetic head positionchecking section 124 controls the diagnosis processing section 123 toend the diagnosis process.

FIG. 14 is a flow chart illustrating a method executed by the HDD filterdriver 33 and the magnetic head position checking section 124 to checkthe position of the magnetic head 11.

First, the HDD filter driver 33 issues an unload command in response toan escape request from the shock prediction section 65 (step 1401). TheHDD filter driver 33 measures the time elapsing from the time of theissuance (step 1402). Then, if an escape process for the magnetic head11 has been completed before the elapsed time exceeds a preset time T(for example, 100 μsec), then the HDD filter driver 33 transmits acorresponding operation completion notification to the magnetic headposition checking section 124 (step 1404). On receiving thenotification, the magnetic head position checking section 124 determinesthat the magnetic head 11 has already been unloaded (step 1405). Themagnetic head position checking section 124 has the diagnosis processingsection 123 end the diagnosis process (step 1406).

On the other hand, if the elapsed time has exceeded the preset time Tbefore the escape process for the magnetic head 11 is completed (steps1402 and 1403), the operation completion notification is not transmittedfrom the HDD filter driver 33 to the magnetic head position checkingsection 124. Accordingly, the magnetic head position checking section124 does not determine that the magnetic head 11 has been unloaded.Consequently, the diagnosis processing section 123 continues thediagnosis process.

Now, description will be given of the general flow of a diagnosisprocess executed after a shock prediction according to the presentembodiment.

FIG. 15 is a flow chart illustrating the flow of a diagnosis processaccording to the present embodiment.

As shown in FIG. 15, when the shock prediction section 65 predicts theoccurrence of a shock (steps 1501 and 1502), the HDD filter driver 33issues an unload command to the magnetic disk device 10 in accordancewith an escape request from the shock prediction section 65. Then, themagnetic head 11 starts an escape operation (step 1503).

Then, if the magnetic head position checking section 124 has controlledthe diagnosis processing section 123, i.e. if the magnetic head 11 hasalready been unloaded, the diagnosis process is immediately ended (steps1504 and 1501). Thus, if the magnetic head 11 has been unloaded beforethe magnetic head 11 starts an escape operation, the diagnosis processaccording to the present embodiment is ended without determining whetheror not the magnetic head 11 could have escaped within the pre-shockperiod.

If the magnetic head 11 has been loaded and the magnetic head positionchecking section 124 has not controlled the diagnosis processing section123, then the pre-shock period measurement section 121, the magnetichead escape completion time measurement section 122, and the diagnosisprocessing section 123 determine whether or not a shock has beendetected before the magnetic head 11 escapes completely (steps 1505 and1506).

If the magnetic head 11 has completed an escape operation before a shockis detected, then it is unlikely that the magnetic head 11 will collideagainst and damage the magnetic disk 12. Accordingly, the diagnosisprocess is ended (steps 1506 and 1501).

On the other hand, if a shock is detected before the magnetic head 11completes an escape operation, the magnetic head 11 may have collidedagainst and damaged the magnetic disk 12. Accordingly, a warning messageis transmitted to the user (steps 1505 and 1507). Then, the diagnosisprocess is ended (step 1501).

As described above, according to the diagnosis process executed by themagnetic disk device 10 according to the present invention, if an actualshock follows a shock prediction, it is determined whether or nor themagnetic head 11 performed an escape operation in time. Then, if themagnetic head 11 may have collided against and damaged the magnetic disk12, a corresponding warning is given to the user to prompt him or her toexecute a recovery process such as data backup. That is, if the magneticdisk device or the information processing apparatus 100 has been shockedand it is unknown whether or not a fault is occurring in the operatingmagnetic disk device 10, then this can be determined with a specifiedaccuracy.

It is thus possible to avoid a secondary fault in which the magnetichead 11 collides against the magnetic disk 12 to scrape the coatedmagnetic surface of the disk 12 and subsequently the resultant finefragments of the surface farther damage the surface of the disk 12 whilethe magnetic disk 10 is operating, resulting in loss of more data.

In the above embodiments, the information processing apparatus 100 suchas a notebook type computer is assumed. It goes without saying that thepresent embodiment is also applicable to a unitary magnetic disk deviceor various other devices such as a hard disk recorder which are providedwith a magnetic disk device as a storage means.

While various embodiments have been described above, it should beunderstood that they have been presented by way of example only, and notlimitation. Thus, the breadth and scope of a preferred embodiment shouldnot be limited by any of the above-described exemplary embodiments, butshould be defined only in accordance with the following claims and theirequivalents.

1. A mechanical transport device comprising: a system for transport,wherein the system for transport is a vehicle; and a hard disk drivedata storage system attached to said transport system, wherein the harddisk drive data storage system comprises: a magnetic recording disk torecord data; a head to read or write the data to or from the disk; and ashock manager designed to detect a shock condition, wherein the harddisk drive data storage system performs the following operation upondetecting a shock condition: dividing an access request to said magneticdisk device into access requests with a smaller data size per access. 2.The mechanical transport device of claim 1, wherein sensing of the shockcondition by the shock manager is changed adaptively.
 3. The mechanicaltransport device of claim 1, wherein the shock condition includes or isderived from information from a sensor about an environmental conditionof the hard disk drive data storage system.
 4. A mechanical transportdevice comprising: a system for transport; and a hard disk drive datastorage system attached to said transport system, wherein the hard diskdrive data storage system comprises: a magnetic recording disk to recorddata; a head to read or write the data to or from the disk; a sensordesigned to sense an environmental condition of the hard disk drive datastorage system indicative of a shock condition; and a shock manager fordetecting a shock condition based on information from the sensor,wherein the hard disk drive data storage system performs at least one ofthe following operations upon detecting a shock condition: dividing anaccess request to said magnetic disk device into access requests with asmaller data size per access, and causing the head to escape from thedisk, wherein if the hard disk drive data storage system determines thata shock actually occurs after the head has been instructed to escape,the hard disk drive data storage system determines whether or not themagnetic head has escaped before the occurrence of the shock, whereinthe hard disk drive data storage system further comprises: aninformation acquisition mechanism for acquiring current informationabout an environmental change of a magnetic disk device; a shockprediction mechanism for analyzing the current information acquired bysaid information acquisition mechanism together with a history thereofoccurring immediately prior to the current information, and fordetermining a status of where said magnetic disk device is used, so asto perform a shock prediction; and a control mechanism for controllingoperations of said magnetic disk device including a magnetic head escapeoperation based on a prediction result by said shock predictionmechanism, wherein the history analyzed is longer than an anticipatedtime required for a fall, wherein if a variation in the status wheresaid magnetic disk device is used falls within a specified range for aspecified period, said shock prediction mechanism does not predict thata shock will be caused by the variation in the status.
 5. A mechanicaltransport device comprising: a system for transport; and a hard diskdrive data storage system attached to said transport system, wherein thehard disk drive data storage system comprises: a magnetic recording diskto record data; a head to read or write the data to or from the disk; asensor designed to sense an environmental condition of the hard diskdrive data storage system indicative of a shock condition; and a shockmanager for detecting a shock condition based on information from thesensor, wherein the hard disk drive data storage system performs atleast one of the following operations upon detecting a shock condition:dividing an access request to said magnetic disk device into accessrequests with a smaller data size per access, and causing the head toescape from the disk, wherein if the hard disk drive data storage systemdetermines that a shock actually occurs after the head has beeninstructed to escape, the hard disk drive data storage system determineswhether or not the magnetic head has escaped before the occurrence ofthe shock, wherein the hard disk drive data storage system furthercomprises: an information acquisition mechanism for acquiring currentinformation about an environmental change of a magnetic disk device; ashock prediction mechanism for analyzing the current informationacquired by said information acquisition mechanism together with ahistory thereof occurring immediately prior to the current information,and for determining a status of where said magnetic disk device is used,so as to perform a shock prediction; and a control mechanism forcontrolling operations of said magnetic disk device including a magnetichead escape operation based on a prediction result by said shockprediction mechanism, wherein if the status of where said magnetic diskdevice is used varies in a predetermined pattern, said shock predictionmechanism predicts that a shock will be caused by the variation in thestatus.
 6. A mechanical transport device comprising: a system fortransport; and a hard disk drive data storage system attached to saidtransport system, wherein the hard disk drive data storage systemcomprises: a magnetic recording disk to record data; a head to read orwrite the data to or from the disk; a sensor designed to sense anenvironmental condition of the hard disk drive data storage systemindicative of a shock condition; and a shock manager for detecting ashock condition based on information from the sensor, wherein the harddisk drive data storage system performs at least one of the followingoperations upon detecting a shock condition: dividing an access requestto said magnetic disk device into access requests with a smaller datasize per access, and causing the head to escape from the disk, whereinif the hard disk drive data storage system determines that a shockactually occurs after the head has been instructed to escape, the harddisk drive data storage system determines whether or not the magnetichead has escaped before the occurrence of the shock, wherein the harddisk drive data storage system further comprises: an informationacquisition mechanism for acquiring current information about anenvironmental change of a magnetic disk device; a shock predictionmechanism for analyzing the current information acquired by saidinformation acquisition mechanism together with a history thereofoccurring immediately prior to the current information, and fordetermining a status of where said magnetic disk device is used, so asto perform a shock prediction; and a control mechanism for controllingoperations of said magnetic disk device including a magnetic head escapeoperation based on a prediction result by said shock predictionmechanism, wherein said shock prediction mechanism predicts a shock withreference to a history of input operations provided by a predeterminedinput device, wherein said input device is selected from a keyboard anda mouse coupled to a computer system which is in communication with themagnetic disk device.
 7. A mechanical transport device comprising: asystem for transport; and a hard disk drive data storage system attachedto said transport system, wherein the hard disk drive data storagesystem comprises: a magnetic recording disk to record data; a head toread or write the data to or from the disk; a sensor designed to sensean environmental condition of the hard disk drive data storage systemindicative of a shock condition; and a shock manager for detecting ashock condition based on information from the sensor, wherein the harddisk drive data storage system performs at least one of the followingoperations upon detecting a shock condition: dividing an access requestto said magnetic disk device into access requests with a smaller datasize per access, and causing the head to escape from the disk, whereinif the hard disk drive data storage system determines that a shockactually occurs after the head has been instructed to escape, the harddisk drive data storage system determines whether or not the magnetichead has escaped before the occurrence of the shock, wherein the harddisk drive data storage system further comprises an informationacquisition mechanism for acquiring current information about anenvironmental change of a magnetic disk device; a shock predictionmechanism for analyzing the current information acquired by saidinformation acquisition mechanism together with a history thereofoccurring immediately prior to the current information, and fordetermining a status of where said magnetic disk device is used, so asto perform a shock prediction; and a control mechanism for controllingoperations of said magnetic disk device including a magnetic head escapeoperation based on a prediction result by said shock predictionmechanism, wherein said information acquiring mechanism acquiresinformation on acceleration of said magnetic disk device, and said shockprediction mechanism recognizes the status where the magnetic diskdevice is used based on the acceleration information acquired by saidinformation acquiring mechanism.
 8. A mechanical transport devicecomprising: a system for transport; and a hard disk drive data storagesystem attached to said transport system, wherein the hard disk drivedata storage system comprises: a magnetic recording disk to record data;a head to read or write the data to or from the disk; and a sensordesigned to sense an environmental condition of the hard disk drive datastorage system indicative of a shock condition; and a shock manager fordetecting a shock condition based on information from the sensor,wherein the hard disk drive data storage system performs at least one ofthe following operations upon detecting a shock condition: dividing anaccess request to said magnetic disk device into access requests with asmaller data size per access, and causing the head to escape from thedisk, wherein if the hard disk drive data storage system determines thata shock actually occurs after the head has been instructed to escape,the hard disk drive data storage system determines whether or not themagnetic head has escaped before the occurrence of the shock, whereinthe hard disk drive data storage system further comprises: aninformation acquisition mechanism for acquiring current informationabout an environmental change of a magnetic disk device; a shockprediction mechanism for analyzing the current information acquired bysaid information acquisition mechanism together with a history thereofoccurring immediately prior to the current information, and fordetermining a status of where said magnetic disk device is used, so asto perform a shock prediction; and a control mechanism for controllingoperations of said magnetic disk device including a magnetic head escapeoperation based on a prediction result by said shock predictionmechanism, wherein if said shock prediction mechanism determines thatsaid magnetic disk device is stable, the shock prediction mechanismnotifies said control mechanism that said magnetic disk device isstable, and said control mechanism returns said escaping magnetic headin response to said notification, wherein said shock predictionmechanism adaptively determines whether or not said magnetic disk deviceis stable, based on a history of the information acquired by saidinformation acquiring mechanism before a shock is predicted to occur. 9.A system for reading or writing data comprising: a hard disk driveincluding: a magnetic recording disk to record data; a head to read orwrite the data to or from the disk; and a shock manager designed todetect a shock condition; and wherein the shock manager detects theshock condition based on a shock value being over a predeterminedthreshold level, wherein the shock value is determined by combiningvalues of a linear accelerometer and an angular speed sensor.
 10. Thesystem of claim 9, wherein the threshold level is automatically adjustedafter being set by a user.
 11. The system of claim 10, wherein thethreshold level is automatically adjusted based on a condition includingat least one of turning off of an LCD monitor, striking of a keyboard,and manipulating of a mouse.
 12. The system of claim 10, wherein thethreshold level is adjusted when the system detects a variation inacceleration with a particular pattern.
 13. The system of claim 12,wherein the variation in acceleration is due to walking.
 14. The systemof claim 12, wherein the variation in acceleration is due to a fall froma lap of a user.
 15. The system of claim 12, wherein the variation inacceleration is sampled with use of a variable clock.
 16. The system ofclaim 12, wherein the variation in acceleration is detected with use ofsampling at variable intervals.
 17. A system for reading or writing datacomprising: a hard disk drive including: a magnetic recording disk torecord data; a head to read or write the data to or from the disk; and ashock manager designed to detect a shock condition; and wherein theshock manager detects the shock condition based on a shock value beingover an adaptable threshold level set by a user, wherein the shock valueis determined by combining values of a linear accelerometer and anangular speed sensor.
 18. A system for reading or writing datacomprising: a hard disk drive including: a magnetic recording disk torecord data; a head to read or write the data to or from the disk; and asensor designed to sense environmental changes of the hard disk drive;and a shock manager for analyzing information from the sensor forpredicting occurrence of a shock, wherein the shock manager determinesoccurrence of a shock based on a shock value being over a predeterminedthreshold, wherein the shock value is determined by combining values ofa linear accelerometer and an angular speed sensor.
 19. The system ofclaim 18, wherein the diagnosis includes reviewing head escape timevelocity to determine if the magnetic recording disk includes defects.